package com.tfj.mvp.tfj.detail.comment;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.hyphenate.tfj.R;
import com.tfj.mvp.base.BaseActivity;
import com.tfj.mvp.tfj.detail.adapter.QuickAdapter_Comment;
import com.tfj.mvp.tfj.detail.bean.CommentBean;
import com.tfj.utils.RecycleViewDivider;
import com.tfj.utils.SysUtils;

import java.util.ArrayList;
import java.util.List;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Liang_Lu on 2017/12/21.
 *
 * @author HuangQiang
 * @github https://github.com/HuangQiang
 */

public class VCommentActivity extends BaseActivity<PCommentImpl> implements CComment.IVComment {


    @BindView(R.id.btn_comment)
    Button btnComment;
    @BindView(R.id.recyclew_content)
    RecyclerView recyclewContent;

    @Override
    protected void initView() {
        super.initView();
        setTitleText("楼盘评论");
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
        recyclewContent.setLayoutManager(linearLayoutManager);
        QuickAdapter_Comment quickAdapter_comment = new QuickAdapter_Comment(R.layout.item_comment_detail);
        recyclewContent.setLayoutManager(linearLayoutManager);
        //添加自定义分割线：可自定义分割线高度和颜色
        recyclewContent.addItemDecoration(new RecycleViewDivider(
                mContext, LinearLayoutManager.HORIZONTAL, SysUtils.dip2px(this,12), getResources().getColor(R.color.lineColor)));
        recyclewContent.setAdapter(quickAdapter_comment);
        List<CommentBean> commentBeans = new ArrayList<>();
        commentBeans.add(new CommentBean());
        commentBeans.add(new CommentBean());
        commentBeans.add(new CommentBean());
        commentBeans.add(new CommentBean());
        commentBeans.add(new CommentBean());
        quickAdapter_comment.replaceData(commentBeans);

    }

    @Override
    public int setContentViewId() {
        return R.layout.activity_comment;
    }

    @Override
    public void createPresenter() {
        mPresenter = new PCommentImpl(mContext, this);
    }

    @Override
    public void showLoading() {

    }

    @Override
    public void hideLoading() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }

    @OnClick(R.id.btn_comment)
    public void onViewClicked(View v) {
        switch (v.getId()) {
            case R.id.btn_comment:
                break;
        }
    }
}
